package com.taobao.api.request;

import com.taobao.api.internal.util.RequestCheckUtils;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;

import com.taobao.api.response.GearfactoryInterceptOrderCallbackResponse;

/**
 * TOP API: taobao.gearfactory.intercept.order.callback request
 * 
 * @author top auto create
 * @since 1.0, 2018.10.23
 */
public class GearfactoryInterceptOrderCallbackRequest extends BaseTaobaoRequest<GearfactoryInterceptOrderCallbackResponse> {
	
	

	/** 
	* ("1001", "已发货拦截失败"), ("1002", "已出库拦截失败"), ("1003", "已配货拦截失败"), ("1004", "已拣货拦截失败"), ("1005", "在途中拦截失败"), ("1006", "库存占用拦截失败"), ("1007", "未获取订单拦截失败"), ("1008", "未定义异常失败"), ("1009", "奇门接口调用异常")
	 */
	private String errorCode;

	/** 
	* 截单的子订单id列表
	 */
	private String subOrderIds;

	/** 
	* 是否截单成功，true：成功，false：失败
	 */
	private Boolean success;

	/** 
	* 主订单id
	 */
	private String tid;

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}

	public String getErrorCode() {
		return this.errorCode;
	}

	public void setSubOrderIds(String subOrderIds) {
		this.subOrderIds = subOrderIds;
	}

	public String getSubOrderIds() {
		return this.subOrderIds;
	}

	public void setSuccess(Boolean success) {
		this.success = success;
	}

	public Boolean getSuccess() {
		return this.success;
	}

	public void setTid(String tid) {
		this.tid = tid;
	}

	public String getTid() {
		return this.tid;
	}

	public String getApiMethodName() {
		return "taobao.gearfactory.intercept.order.callback";
	}

	public Map<String, String> getTextParams() {		
		TaobaoHashMap txtParams = new TaobaoHashMap();
		txtParams.put("error_code", this.errorCode);
		txtParams.put("sub_order_ids", this.subOrderIds);
		txtParams.put("success", this.success);
		txtParams.put("tid", this.tid);
		if(this.udfParams != null) {
			txtParams.putAll(this.udfParams);
		}
		return txtParams;
	}

	public Class<GearfactoryInterceptOrderCallbackResponse> getResponseClass() {
		return GearfactoryInterceptOrderCallbackResponse.class;
	}

	public void check() throws ApiRuleException {
		RequestCheckUtils.checkMaxListSize(subOrderIds, 20, "subOrderIds");
	}
	

}